# 进程数
proc_num=16
# 测试采样次数
sample_time=4

# 测试目标
target="mpich3-fsom"

if [[ $target = "mpich3" ]]; then
    export PATH=/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/ibutils/bin:/root/zyq/mpich3/mpich3-install/bin:/root/bin
elif [[ $target = "mpich3-fsom" ]]; then
    export PATH=/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/ibutils/bin:/root/zyq/mpich3-fsom/mpich3-fsom-install/bin:/root/bin
fi

# 消息大小，对于散发操作而言，为接收方的消息大小，发送消息的大小则为（proc_num*msg_sz）
msg_sz=$1

# 被测试的集合操作
# 为BCAST_Latency或SCATTER_Latency
coll_ops="SCATTER_Latency"

mpicc  mbench.c -o mbench
echo "--------" $msg_sz "--------"
mpiexec -n $proc_num -f machinefile ./mbench $msg_sz $sample_time $coll_ops
